using Sedge.Core.Configuration;
using Sedge.Core.Execution;
using Sedge.Core.Execution.ReportElements;

namespace Demo.Customization.UI
{
	public class SingleStepController : IStepController
	{
		private Suite _suite;
		private Options _options;
		
		private SingleStepView _view;
		public object View
		{
			get
			{
				if (_view == null)
					_view = new SingleStepView();
				return _view;
			}
		}

		public string Caption
		{
			get { return "Step Caption"; }
		}

		public void Initialize(Suite suite, Options options)
		{
			_suite = suite;
			_options = options;
		}

		public bool EnterStep(bool fromPrev)
		{
			return true;
		}

		public bool LeaveStep(bool toNext)
		{
			if (toNext)
			{
				ReportTable reportTable = new ReportTable(_suite);
				reportTable.AddRow("Description: ", _view.textBox.Text);
				_suite.TempData["description"] = reportTable;
			}
			return false;
		}
	}
}